How to Discard Changes Using DXL Triggers?

 

I know that when I am editing an object attribute in place in the current view that I can hit the <Escape> key from my keyboard and all of the changes to that attribute for that object are discarded and the original text of that attribute is restored.  When this happens, the change bars do not indicate that the object has been modified and the discarded changes do not appear in the object's history.  How can I do the same using DXL?

Here's what I want to do.  I have a trigger defined as follows:

Trigger myTrig = trigger("Pre Modify Object Text", module->all->object->all->attribute->"Object Text", pre, modify, 10, "#include <myCode.dxl>")


The trigger myTrig triggers each time I modify attribute "Object Text" in place and executes before the object attribute is updated (written).  The file "myCode.dxl" checks to see if certain conditions exist for the current object.  If these conditions are true, then I want the edits to the "Object Text" attribute to be abandoned and the original text restored, just as if I was editing the attribute in place.

I know that there are methods to just restore the value I want to the object's attribute, but all the ones that I'm familiar with would change the change bars to indicate an unsaved change and cause the revision history to be updated.


BeastBoysDad - Fri Oct 11 20:38:29 EDT 2013

Re: How to Discard Changes Using DXL Triggers?
sekrbo - Mon Oct 14 03:36:15 EDT 2013

I think you're looking for

set(trigPreConFail)

/sekrbo

Re: How to Discard Changes Using DXL Triggers?
BeastBoysDad - Mon Oct 14 13:15:35 EDT 2013

sekrbo - Mon Oct 14 03:36:15 EDT 2013

I think you're looking for

set(trigPreConFail)

/sekrbo

Worked perfectly for my needs!  Thank you!